# Maintainer(Arch): Alexander F Rødseth <xyproto@archlinux.org>
# Contributor: Jared Casper <jaredcasper@gmail.com>
# Contributor: Paulo Matias <matias archlinux-br org>
# Maintainer: Sagar Acharya <sagaracharya@tutanota.com>

pkgname=iverilog
pkgver=11.0
pkgrel=1
pkgdesc='Icarus Verilog compiler and simulation tool'
arch=('x86_64')
url='http://iverilog.icarus.com/'
license=('GPL-2')
depends=('zlib' 'bzip2')
makedepends=('gperf' 'git')
options=('staticlibs')
source=("https://github.com/steveicarus/iverilog/archive/refs/tags/v${pkgver/./_}.tar.gz")
sha512sums=('5d6a65e1c3b6b62e99af708cd5a259cc69c6b789dd6eff69e225903d9b8c115d9e5d6f7635b30c6558197cd0ee6fd8196a163fbd98956e24c211d97328b85056')

prepare() {
  cd "$pkgname-${pkgver/./_}"

  aclocal
  autoconf
}

build() {
  cd "$pkgname-${pkgver/./_}"

  CFLAGS+=' -fcommon'

  ./configure --prefix=/usr
  make
}

package() {
  make -C "$pkgname-${pkgver/./_}" -j1 prefix="$pkgdir/usr" install
  install -Dm644 $pkgname-${pkgver/./_}/COPYING -t $pkgdir/usr/share/licenses/$pkgname
}
